#coding:utf8

import pandas as pd
from pyspark.sql import SparkSession
from pyspark.sql.types import StructType, StringType, IntegerType

# 读取json文件创建DF
if __name__ == '__main__':
    # 构建SparkSession执行环境入口对象
    spark = SparkSession.builder.\
        appName("test_json").\
        master("local[*]").\
        getOrCreate()

    # json可以识别String类型和数字类型
    df = spark.read.format("json").load('../data/input/sql/people.json')

    df.show()